package com.study.security.web.filter;

import javax.servlet.*;
import java.io.IOException;

//@Component
public class MyFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
//        System.out.println("filter init...");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//        System.out.println("filter do...");
        long start = System.currentTimeMillis();
        filterChain.doFilter(servletRequest, servletResponse);
        long end = System.currentTimeMillis();
//        System.out.println("time filter 耗时：" + (end - start));

    }

    @Override
    public void destroy() {
//        System.out.println("filter destroy...");

    }
}
